package TextDocument;

import Util.UiUtil;

import javax.swing.*;
import java.awt.*;

public class UserAgreement {
    public static boolean isHelp;
    JFrame jf;
    JTextArea jt;
    JScrollPane jsp;

    public UserAgreement() {
        jf = new JFrame("User agreement");
        jf.setSize(800, 600);

        jt = new JTextArea();
        jt.setLineWrap(true);
        jt.setFont(new Font("", Font.PLAIN, 20));
        if (!isHelp)
            jt.setText("Dear user, \n\tin the process of registering as a Ctrip user, you need to complete our registration process and sign the following agreement online by clicking agree. " +
                    "Please read carefully and fully understand the terms in the agreement before you click agree, especially in bold font.\n" +
                    "Privacy policy\n" +
                    "\tThe privacy policy defines the types, methods and uses of personal information collected, used and shared by our products and / or services, and the methods for users to query, correct and delete personal information. " +
                    "The specific outline is as follows:\n" +
                    "1. Confirmation and acceptance of privacy policy\n " +
                    "2. Information collection\n " +
                    "3. Information use\n " +
                    "4. Information sharing, transfer and disclosure\n " +
                    "5. Information preservation and cross-border transmission\n " +
                    "6. Use of cookies\n " +
                    "7. Tips for personal sensitive information\n " +
                    "8. Information security and protection\n " +
                    "9. Information security incident handling\n " +
                    "10. Minor information protection\n " +
                    "11. User personal information management\n " +
                    "12. visit our website 13. from outside the mainland of China\n " +
                    "13. the scope of application of privacy policy\n " +
                    "14. how to modify our privacy policy\n " +
                    "15. how to contact our\n " +
                    "16. law\n" +
                    "[careful reading] before you click \"agree\" in the registration application process, you must carefully read and fully understand the relevant provisions in the agreement, especially the provisions on exemption or limitation of liability agreed with you, and the important terms of bold font logo.\n" +
                    "[please note] if you do not agree to the above agreement or any of its terms, please stop registering. If you fill in the information, read and click to agree to the above agreement and complete the registration process, you have fully read, understood and accepted all the contents of the agreement. If you have any questions about the above, please contact: privacy@ctrip.com 。\n" +
                    "By clicking \"agree\", you have read and agreed to Ctrip's \"service agreement\" and \"privacy policy\", and agree that we will share your order information with the third party partners necessary to complete this order");
        else
            jt.setText("Sign up\n" +
                    "    In the use of this program, you can directly use the default administrator account login. The account is happyer and the password is 123456.\n" +
                    "    You can use the registration system to register your own account, but they are all ordinary tourist accounts, and the administrator account cannot be registered.\n" +
                    "    If you forget your account and password, you can retrieve it through your mobile phone number.\n" +
                    "    When you want to change your password, you must log in before you can change your password.\n" +
                    "    The account number is 6-10 digit array or letter\n" +
                    "    The password is 6-18 and consists of numbers, letters or underscores\n" +
                    "administrators\n" +
                    "    The administrator can modify and delete the existing travel.\n" +
                    "    Administrators can add new travel routes.\n" +
                    "    You can click the corresponding button on the personal homepage to enter the tourism management page, and modify / delete the selected line. You can also right-click the row to select the operation to be performed.\n" +
                    "user\n" +
                    "    Users can view all the travel routes.\n" +
                    "    Users can select travel routes according to the place of departure or destination.\n" +
                    "    Users can add travel routes to their shopping cart.\n" +
                    "    Users can pay for the travel that the cart has added.\n" +
                    "    Users can view their shopping cart and paid travel orders.");
        jt.setBounds(20, 20, 180, 280);

        jsp = new JScrollPane();
        jsp.setViewportView(jt);

        jf.add(jsp);
        UiUtil.setFrameCenter(jf);
        jf.setVisible(true);
    }
}
